package pay.entity;


import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import pay.config.DataBaseName;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 优惠券表
 *
 * @TableName coupon
 */
@TableName("coupon")
@Data
public class CouponEntity extends BaseEntity {
    /**
     * 优惠券id
     */
    @TableId
    private Integer id;

    /**
     * 优惠券名
     */
    @TableField("name")
    private String name;

    /**
     * 类型 1:满减券 2:折扣券
     */
    @TableField("type")
    private Integer type;

    /**
     * 优惠券面额
     */
    @TableField(value = "amount")
    private BigDecimal amount;

    /**
     * 折扣率
     */
    @TableField(value = "discount")
    private BigDecimal discount;

    /**
     * 是否有门槛 1:是 0:否
     */
    @TableField("is_threshold")
    private Integer isThreshold;

    /**
     * 门槛金额
     */
    @TableField(value = "threshold_amount")
    private BigDecimal thresholdAmount;

    /**
     * 状态 1:待启用 2:进行中 3:已作废
     */
    @TableField("status")
    private Integer status;

    /**
     * 有效期类型 1:固定日期 2:发放之后
     */
    @TableField("validity_type")
    private Integer validityType;

    /**
     * 开始日期
     */
    @TableField(value = "start_time")
    @JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss")
    private Date startTime;

    /**
     * 结束时间
     */
    @TableField(value = "end_time")
    @JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss")
    private Date endTime;

    /**
     * 发放之后的有效期天数
     */
    @TableField(value = "grant_useful_day")
    private Integer grantUsefulDay;

    /**
     * 使用场景 1-赛事赛项 2-全平台通用
     */
    @TableField("usage_scenario")
    private Integer usageScenario;

    /**
     * 赛项id
     */
    @TableField(value = "authenticated_game_project_id")
    private String authenticatedGameProjectId;

    /**
     * 使用须知
     */
    @TableField("description")
    private String description;

    /**
     * 逻辑删除
     */
    @TableField("del")
    @TableLogic
    private Integer del;

    /**
     * 优惠券绑定的goods
     */
    @TableField(exist = false)
    private List<GoodsEntity> goodsList;

    @TableField(exist = false)
    private List<CouponAppUserEntity> couponAppUserList;

}